﻿using UnityEngine;
using System.Collections;

public class GameUtils {

	// Use this for initialization
    public static void SetControl(){
	    if(InGameSetting.inputMode == InputType.VIRTUALJOYSTICK)
        {
            GameObject[] heroes = GameObject.FindGameObjectsWithTag("Hero");
            foreach(GameObject go in heroes)
            {
                ManuelController manuel = go.GetComponent<ManuelController>();
                manuel.enabled = true;
              
                TouchScreenController touch = go.GetComponent<TouchScreenController>();
                touch.enabled = false;
            }

        }
        else if(InGameSetting.inputMode == InputType.FINGERTAPSWIPE)
        {
            GameObject[] heroes = GameObject.FindGameObjectsWithTag("Hero");
            foreach(GameObject go in heroes)
            {
                ManuelController manuel = go.GetComponent<ManuelController>();
                manuel.enabled = false;
                
                TouchScreenController touch = go.GetComponent<TouchScreenController>();
                touch.enabled = true;
            }
        }
	}
	
}
